import { fromJS } from 'immutable'
import { actionType } from './index'

// 将对象转换为immutable对象，immutable意为不可修改
const defaultState = fromJS({
  login: false,
  
})
const reducer = (state = defaultState, action) => {
  switch (action.type) {
    case actionType.LOG_IN:
      return state.set('login', true)
    case actionType.LOG_OUT: 
      return state.set('login', false)
    default:
      return state
  }
}

export default reducer